package com.mewpipe.adminservlet;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.mewpipe.dao.DaoFactory;
import com.mewpipe.dao.UserDao;
import com.mewpipe.entity.User;

@SuppressWarnings("serial")
@WebServlet ("/AdminContent/GestionUser")
public class GetAllUserServlet extends HttpServlet{




	private UserDao userDao;
	@Override
	public void init() throws ServletException {
		userDao = DaoFactory.getInstance().getUserDao();
	}
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		List<User>	Userslist = userDao.getAllUser();
		req.setAttribute("Userslist",(List<User>) Userslist);
		req.getRequestDispatcher("/AdminContent/GestionUser.jsp").forward(req, resp);	
	}

}
